package com.macro.mall;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.test.context.junit4.SpringRunner;

// @RunWith(SpringRunner.class)
// @SpringBootTest
public class EncodePass {
  BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
  // @Autowired
  // PasswordEncoder passwordEncoder;

  @Test
  public void encode(){
    String code = encoder.encode("banyuan");
    System.out.println(code);
    System.out.println(encoder.matches("banyuan",code));
    // System.out.println(encoder.encode("banyuan"));
  }
}
